import { ref } from 'vue'

import { imagePath } from '@/libs/file-utils'
import { showShareMask } from './share-mask/data'

const icon_qq = imagePath('community/friend/invite/icon-qq.png')
const icon_dy = imagePath('community/friend/invite/icon-dy.png')
const icon_xhs = imagePath('community/friend/invite/icon-xhs.png')

const shareAppList = [
  {
    key: 'qq',
    icon: icon_qq,
    url: 'qq',
    qrcode: '',
  },
  {
    key: 'dy',
    icon: icon_dy,
    url: 'dy',
    qrcode: '',
  },
  {
    key: 'xhs',
    icon: icon_xhs,
    url: 'xhs',
    qrcode: '',
  },
]
const curShareAppIdx = ref(-1)

export { shareAppList, curShareAppIdx }

const chooseApp = (idx: number) => {
  curShareAppIdx.value = idx
  showShareMask.value = true
}

export { chooseApp }
